package javase.CollectionAndMap.list;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public class ArrayToListDemo {

    public static void main(String[] args) {
        //数组 -> 集合  asList
        String[] arr = {"abc","aaa","bbb","abd","esd"};
        List<String> list = Arrays.asList(arr);
        System.out.println(list);

        List<Integer> integers = new ArrayList<>();
        integers.add(10);
        integers.add(20);
        integers.add(30);
        integers.add(40);
        integers.add(20);
        //集合 -> 数组  toArray
        Integer[] array = integers.toArray(new Integer[]{});
        System.out.println(Arrays.toString(array));
    }

}
